package org.leaf.green.b2b

class Staff {

    String serialNumber
    String name
    Department department 
    Date dateCreated
    Date lastUpdated

    Boolean isActive
    
    static constraints = {
        serialNumber(nullable:false, blank:false, maxSize:5, unique:true)
        name(nullable:false, blank :false, maxSize:10)
        department(nullable:false)
        isActive(nullable:true)
    }

    String toString() {
        return "$serialNumber-$name"
    }
    
    static mapping = {
        table 'B2B_STAFF'
    }
    
}
